package com.example.juegoenandroid;


import android.os.Bundle;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainActivity extends Activity  {

	
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		
		Button opc1= (Button) findViewById(R.id.BottonJugadorVSCPU);
		Button opc2= (Button) findViewById(R.id.BottonJugadorVSJugador);
		
		opc1.setOnClickListener(new OnClickListener() {
			
			public void onClick(View v) {
				
				Intent i=new Intent(MainActivity.this,NombreJugador.class);
				i.putExtra("modo", true);
				
				startActivity(i);
			}
		});
		
		opc2.setOnClickListener(new OnClickListener() {
			
			public void onClick(View v) {
				
				Intent i=new Intent(MainActivity.this,NombreJugadores.class);
				i.putExtra("modo", false);
				
				startActivity(i);
				
				
			}
		});
		
		
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		getMenuInflater().inflate(R.menu.main, menu);
		
		return true;
		
	}
	
	public boolean onOptionsItemSelected(MenuItem item) 
	{
		switch(item.getItemId())
		{
		case R.id.MnuOpc1:
		Intent i1=new Intent(MainActivity.this,Reglas.class);
		startActivity(i1);
			break;
		case R.id.MnuOpc2:
		Intent i2=new Intent(MainActivity.this,ReglasGraficas.class);
		startActivity(i2);
			break;
		case R.id.MnuOpc3:
			Intent i3=new Intent(MainActivity.this,Informacion.class);
			startActivity(i3);
			break;
		case R.id.MnuOpc4:
			Intent i4=new Intent(MainActivity.this,Score.class);
			startActivity(i4);
			break;
		}
		return super.onOptionsItemSelected(item);
		
	}
	

}
